<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        var object = new Object();
        object.name = "YG";
        object.age = 20;
        object.fun = function () {
                alert(this.name+this.age)
        }
        object.fun();

        var object1 = {
            name :"YG1",
            age :21,
            fun1 :function () {
                alert(this.name+this.age);
            }
        }
        object1.fun1();
    </script>
</head>
<body>

</body>
</html>